package com.zhou.blog.controller;

import com.zhou.blog.service.SysUserService;
import com.zhou.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @title:UserController
 * @Author Zhou
 * @Date:2022/4/28 21:27
 * @Version 1.0
 */
@RestController
@RequestMapping("api/users")
public class UserController {
    @Autowired
    private SysUserService sysUserService;
    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){

        return sysUserService.findUserByToken(token);
    }
}
